import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import registerServiceWorker from './registerServiceWorker';
import { createStore } from 'redux';
import { Provider } from 'react-redux';
import reducer from './reducers';
import Bg from './page/Link';
import { BrowserRouter, Link, Route, Switch, Redirect } from 'react-router-dom';
var state = {
  lzy: {
    content: '时间的梦'
  },
  show: true
}

var store = createStore(reducer, state);
ReactDOM.render(

  (
    <Provider store={store}>

      <BrowserRouter>
        <div>
          <Switch>
            <Route
              path=" " />
            <Redirect to="/home" />
          </Switch>
          <Link to='/home'>首页</Link>
          <Link to='/tiao/萱草'>路由跳转</Link>
          <Route path='/home' component={App}></Route>
          <Route path='/tiao/:id' component={Bg}>

          </Route>
        </div>
      </BrowserRouter>
    </Provider>
  )
  ,
  document.getElementById('root'));
registerServiceWorker();

// npm i --save-dev react-router  路由
// npm i react-redux --save 状态管理工具
// npm i react-addons-css-transition-group --save 动画